Optimal. Leaf size=194 \[ \frac {\left (a^2 A-2 a b B-A b^2\right ) \tan ^{m+1}(c+d x) \, _2F_1\left (1,\frac {m+1}{2};\frac {m+3}{2};-\tan ^2(c+d x)\right )}{d (m+1)}+\frac {\left (a^2 B+2 a A b-b^2 B\right ) \tan ^{m+2}(c+d x) \, _2F_1\left (1,\frac {m+2}{2};\frac {m+4}{2};-\tan ^2(c+d x)\right )}{d (m+2)}+\frac {b (a B (m+3)+A b (m+2)) \tan ^{m+1}(c+d x)}{d (m+1) (m+2)}+\frac {b B \tan ^{m+1}(c+d x) (a+b \tan (c+d x))}{d (m+2)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.33, antiderivative size = 194, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {3607, 3630, 3538, 3476, 364} \[ \frac {\left (a^2 A-2 a b B-A b^2\right ) \tan ^{m+1}(c+d x) \, _2F_1\left (1,\frac {m+1}{2};\frac {m+3}{2};-\tan ^2(c+d x)\right )}{d (m+1)}+\frac {\left (a^2 B+2 a A b-b^2 B\right ) \tan ^{m+2}(c+d x) \, _2F_1\left (1,\frac {m+2}{2};\frac {m+4}{2};-\tan ^2(c+d x)\right )}{d (m+2)}+\frac {b (a B (m+3)+A b (m+2)) \tan ^{m+1}(c+d x)}{d (m+1) (m+2)}+\frac {b B \tan ^{m+1}(c+d x) (a+b \tan (c+d x))}{d (m+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 364
Rule 3476
Rule 3538
Rule 3607
Rule 3630
Rubi steps
\begin {align*} \int \tan ^m(c+d x) (a+b \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx &=\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))}{d (2+m)}+\frac {\int \tan ^m(c+d x) \left (-a (b B (1+m)-a A (2+m))+\left (2 a A b+a^2 B-b^2 B\right ) (2+m) \tan (c+d x)+b (A b (2+m)+a B (3+m)) \tan ^2(c+d x)\right ) \, dx}{2+m}\\ &=\frac {b (A b (2+m)+a B (3+m)) \tan ^{1+m}(c+d x)}{d (1+m) (2+m)}+\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))}{d (2+m)}+\frac {\int \tan ^m(c+d x) \left (\left (a^2 A-A b^2-2 a b B\right ) (2+m)+\left (2 a A b+a^2 B-b^2 B\right ) (2+m) \tan (c+d x)\right ) \, dx}{2+m}\\ &=\frac {b (A b (2+m)+a B (3+m)) \tan ^{1+m}(c+d x)}{d (1+m) (2+m)}+\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))}{d (2+m)}+\left (a^2 A-A b^2-2 a b B\right ) \int \tan ^m(c+d x) \, dx+\left (2 a A b+a^2 B-b^2 B\right ) \int \tan ^{1+m}(c+d x) \, dx\\ &=\frac {b (A b (2+m)+a B (3+m)) \tan ^{1+m}(c+d x)}{d (1+m) (2+m)}+\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))}{d (2+m)}+\frac {\left (a^2 A-A b^2-2 a b B\right ) \operatorname {Subst}\left (\int \frac {x^m}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}+\frac {\left (2 a A b+a^2 B-b^2 B\right ) \operatorname {Subst}\left (\int \frac {x^{1+m}}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {b (A b (2+m)+a B (3+m)) \tan ^{1+m}(c+d x)}{d (1+m) (2+m)}+\frac {\left (a^2 A-A b^2-2 a b B\right ) \, _2F_1\left (1,\frac {1+m}{2};\frac {3+m}{2};-\tan ^2(c+d x)\right ) \tan ^{1+m}(c+d x)}{d (1+m)}+\frac {\left (2 a A b+a^2 B-b^2 B\right ) \, _2F_1\left (1,\frac {2+m}{2};\frac {4+m}{2};-\tan ^2(c+d x)\right ) \tan ^{2+m}(c+d x)}{d (2+m)}+\frac {b B \tan ^{1+m}(c+d x) (a+b \tan (c+d x))}{d (2+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.74, size = 155, normalized size = 0.80 \[ \frac {\tan ^{m+1}(c+d x) \left (\frac {(m+2) \left (a^2 A-2 a b B-A b^2\right ) \, _2F_1\left (1,\frac {m+1}{2};\frac {m+3}{2};-\tan ^2(c+d x)\right )}{m+1}+\left (a^2 B+2 a A b-b^2 B\right ) \tan (c+d x) \, _2F_1\left (1,\frac {m+2}{2};\frac {m+4}{2};-\tan ^2(c+d x)\right )+\frac {b (a B (m+3)+A b (m+2))}{m+1}+b B (a+b \tan (c+d x))\right )}{d (m+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 1.06, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (B b^{2} \tan \left (d x + c\right )^{3} + A a^{2} + {\left (2 \, B a b + A b^{2}\right )} \tan \left (d x + c\right )^{2} + {\left (B a^{2} + 2 \, A a b\right )} \tan \left (d x + c\right )\right )} \tan \left (d x + c\right )^{m}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{2} \tan \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.26, size = 0, normalized size = 0.00 \[ \int \left (\tan ^{m}\left (d x +c \right )\right ) \left (a +b \tan \left (d x +c \right )\right )^{2} \left (A +B \tan \left (d x +c \right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{2} \tan \left (d x + c\right )^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int {\mathrm {tan}\left (c+d\,x\right )}^m\,\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (A + B \tan {\left (c + d x \right )}\right ) \left (a + b \tan {\left (c + d x \right )}\right )^{2} \tan ^{m}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________